document.addEventListener("plusready", function() {
	plus.adSdk = {
		setUserId : function (userId) {
			return plus.bridge.execSync("AdSdk", "setUserId", [userId])
		},
		showRewardVideoAd : function (params, callback) {
			callbackId = plus.bridge.callbackId(callback, null)
			return plus.bridge.exec("AdSdk", "showRewardVideoAd", [callbackId, params.unitId])
		},
		loadBannerAd : function (params, callback) {
			callbackId = plus.bridge.callbackId(callback, null)
			return plus.bridge.exec("AdSdk", "loadBannerAd", [callbackId, params.unitId, params.margins])
		},
		showBannerAd : function (params, callback) {
			callbackId = plus.bridge.callbackId(callback, null)
			return plus.bridge.exec("AdSdk", "showBannerAd", [callbackId, params.unitId, params.layout, params.margins])
		},
		destroyBannerAd : function (params) {
		    return plus.bridge.execSync("AdSdk", "destroyBannerAd", [params.unitId])
		},
		showInterstitialAd : function (params, callback) {
			callbackId = plus.bridge.callbackId(callback, null)
			return plus.bridge.exec("AdSdk", "showInterstitialAd", [callbackId, params.unitId])
		}
	}
}, true)